﻿using Smobiler.Core;
using Smobiler.Core.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FubiManger.Controls
{
    ////ToolboxItem用于控制是否添加自定义控件到工具箱，true添加，false不添加
    //[System.ComponentModel.ToolboxItem(true)]
    partial class levelcontrol : Smobiler.Core.Controls.MobileUserControl
    {
        public levelcontrol() : base()
        {
            //This call is required by the SmobilerUserControl.
            InitializeComponent();
        }
        public string level { get; set; }
        /// <summary>
        /// 金额
        /// </summary>
        public int amount { get; set; }
        /// <summary>
        /// 消费金额
        /// </summary>
        public int money { get; set; }

        private void levelcontrol_Load(object sender, EventArgs e)
        {
           
            lblmoney.Text = amount.ToString();
          
            switch (level)
            {
                case "LV1":
                    if(money>amount)
                        imgvip.ResourceID = "v1";
                    else
                    imgvip.ResourceID = "v1_1";
                   
                    break;
                case "LV2":
                    if (money > amount)
                        imgvip.ResourceID = "v2";
                    else
                        imgvip.ResourceID = "v2_1";
                    break;
                case "LV3":
                    if (money > amount)
                        imgvip.ResourceID = "v3";
                    else
                        imgvip.ResourceID = "v3_1";
                    break;
                case "LV4":
                    if (money > amount)
                        imgvip.ResourceID = "v4";
                    else
                        imgvip.ResourceID = "v4_1";
                    break;
                case "LV5":
                    if (money > amount)
                        imgvip.ResourceID = "v5";
                    else
                        imgvip.ResourceID = "v5_1";
                    break;
                case "LV6":
                    if (money > amount)
                        imgvip.ResourceID = "v6";
                    else
                        imgvip.ResourceID = "v6_1";
                    break;
                case "LV7":
                    if (money > amount)
                        imgvip.ResourceID = "v7";
                    else
                        imgvip.ResourceID = "v7_1";
                    break;
            }
           
        }
    }
}